package model

/*
@author hujianli
*/
type Book struct {
	Id uint `gorm:"primary_key" json:"id"`
	// Name string `gorm:"not null" json:"name" binding:"required"`
	Name string `gorm:"not null" json:"name"`
	Desc string `json:"desc"`
	//一本书多个用户借阅过,一个用户也可以借阅过多本书，所以是多对多
	Users []User `gorm:"many2many:book_users;"`
}

func (Book) TableName() string {
	return "book"
}
